import request from '@/utils/request'

// 获取全部表格数据
export function getDatas(params) {
  return request({
    url: '/api/practice01/maintenance/find',
    method: 'get',
    params
  })
}

// 获取单个数据
export function getData(id) {
  return request({
    url: `/api/practice01/maintenance/find/${id}`,
    method: 'get'
  })
}

// 修改单个数据
export function updateData(id, params, data) {
  return request({
    url: `/api/practice01/maintenance/update/${id}`,
    method: 'put',
    data,
    params,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 删除单个数据
export function delData(id) {
  return request({
    url: `/api/practice01/maintenance/delete/${id}`,
    method: 'delete'
  })
}

// 新增单个数据
export function addData(data) {
  return request({
    url: '/api/practice01/maintenance/insert',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}
